package com.cbank.service;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cbank.dao.AdminUserDao;
import com.cbank.domain.AdminUser;

@Service
public class AdminUserService extends BaseService<AdminUser, String, Integer>{
	@SuppressWarnings("unused")
	private Logger logger=Logger.getLogger(AdminUserService.class);
	@Autowired
	private AdminUserDao adminUserDao;
	@Override
	public Integer insert(AdminUser adminUser) {
		return adminUserDao.insert(adminUser);
	}

	@Override
	public Integer updateById(AdminUser adminUser) {
		return adminUserDao.updateById(adminUser);
	}

	@Override
	public AdminUser findById(Integer id) {
		return adminUserDao.findById(id);
	}

	@Override
	public AdminUser findByViewId(String viewId) {
		return adminUserDao.findByViewId(viewId);
	}

	@Override
	public List<AdminUser> findAll() {
		return adminUserDao.findAll();
	}
	
	public AdminUser findByUserNameAndPassword(AdminUser adminUser){
		return adminUserDao.findByUserNameAndPassword(adminUser);
	}
	
	public Integer updateTokenById(String token,Integer id){
		return adminUserDao.updateTokenById(token,id);
	}

}
